{include file="common/_meta" /}
<title>新建网站角色 - 管理员管理 </title>
<meta name="keywords" content="李志立，lizhilimaster@163.com">
<meta name="description" content="李志立，lizhilimaster@163.com">
</head>
<body>
<article class="cl pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-category-add-lizhili">
		<input type="hidden" name="id" value="{$data.id}" />
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2"><span class="c-red">*</span>角色名称：</label>
			<div class="formControls col-xs-9 col-sm-10">
				<input type="text" class="input-text" value="{$data.title}" placeholder="" id="title" name="title" datatype="*4-16" nullmsg="用户账户不能为空">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">是否限制修改：</label>
			<div class="formControls col-xs-9 col-sm-10">
				<div class="switch" data-on-label="开" data-off-label="关">
					{if condition="$data.type == 1"}
					<input type="checkbox" checked="checked" name="type" />
					{else /}
					<input type="checkbox" name="type" />
					{/if}
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">备注：</label>
			<div class="formControls col-xs-9 col-sm-10">
				<input type="text" class="input-text" value="{$data.desc}" placeholder="" id="desc" name="desc">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">网站角色：</label>
			<div class="formControls col-xs-9 col-sm-10">
				<dl class="permission-list" id="lizhili">
					{volist name="datasort" id="vo"}
						<dt style="border-bottom: 1px solid #ffd8d8">
							<label>
								{if !$vo.zi}<input type="checkbox" {if in_array($vo.id,$rules)}checked{/if} value="{$vo.id}" id="f{$vo.id}" name="rules[]">{/if}
								{$vo.name}</label>
						</dt>
						{volist name="vo.zi" id="vo2"}
						<div class="check-box" value="{$vo2.id}" style="padding: 8px;">
							<label><input type="checkbox" {if in_array($vo2.id,$rules)}checked{/if} class="f{$vo2.fid}" name="rules[]" value="{$vo2.id}">
								{$vo2.name}</label>
						</div>
						{/volist}
					{/volist}
				</dl>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-3 col-sm-offset-2">
				<button type="submit" class="btn btn-success radius"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</article>
{include file="common/_footer" /}
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#form-category-add-lizhili").validate({
		rules: {
			title: {
				required: true,
			},
		},
		submitHandler:function(form) {
			$("input[type=\"submit\"]").addClass('disabled').attr("disabled",true);
			var index = layer.load(1, {
				shade: [0.1,'#fff'] //0.1透明度的白色背景
			});
			setTimeout(()=>{
				$("input[type=\"submit\"]").removeClass('disabled').attr("disabled",false);
				layer.close(index);
			},1000)
			form.submit();
		}
	});
});
</script>
</body>
</html>